package marketing

import (
	"jlpay-sdk-go/pkg/jlpay/core"
	"jlpay-sdk-go/pkg/jlpay/models/marketing"
	"jlpay-sdk-go/pkg/jlpay/services"
)

// MarketingActivityQueryService 营销活动查询服务
type MarketingActivityQueryService struct {
	*services.BaseService
}

// NewMarketingActivityQueryService 创建新的营销活动查询服务
func NewMarketingActivityQueryService(config *core.Config) *MarketingActivityQueryService {
	return &MarketingActivityQueryService{
		BaseService: services.NewBaseService(config),
	}
}

// Execute 执行营销活动查询请求
func (s *MarketingActivityQueryService) Execute(request *marketing.MarketingActivityQueryRequest) (*marketing.MarketingActivityQueryResponse, error) {
	response := marketing.NewMarketingActivityQueryResponse()

	// 使用request.Path()方法获取正确的API路径，与Python版本保持一致
	apiPath := request.Path()
	err := s.Post(request, response, apiPath)
	if err != nil {
		return nil, err
	}
	return response, nil
}
